package com.langfeiyes.pattern.prototype;

import java.text.MessageFormat;

//短信
public class SMS implements Cloneable{
    private String usename; //用户名
    private String phone;   //手机
    private String content;  //短信内容

    public String getContent(){
        return MessageFormat.format(SMSUtil.getSmsTemplate(), usename, content);
    }

    public String getUsename() {
        return usename;
    }

    public void setUsename(String usename) {
        this.usename = usename;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Object clone = super.clone();
        System.out.println("克隆了，原hashCode：" + this.hashCode() +" 克隆后hashCode：" + clone.hashCode());
        return clone;
    }
}
